const express = require('express')
const formidable = require('formidable');
const path = require('path')
const fs = require('fs')
const router = express.Router()
const studentsController = require('../../controllers/students.controller.js')

// 这里上传的数据格式是formdata 所以需要用到 formidable
router.post('/', studentsController.addStudents)

// 获取学生列表
router.get('/', studentsController.getStudents)

// 删除某个学生
router.delete('/:id', studentsController.deleteStudent)

// 修改学员
router.put('/:id', studentsController.editStudent)

module.exports = router